<template>
  <div class="progress">
    <div class="chunk-list">
      <div class="chunk-item">
        <div class="title">
          <div class="tag">
            <img :src="oneData.icon">
          </div>
          <div class="title-content"><label>{{oneData.text}}</label></div>
        </div>
        <div class="text text-border">
          <div class="dsc">{{oneDataDsc}}</div>
        </div>
      </div>
      <div class="chunk-item">
        <div class="title">
          <div class="tag">
            <img :src="twoData.icon">
          </div>
          <div class="title-content"><label>{{twoData.text}}</label></div>
        </div>
        <div class="text">
          <div class="dsc">{{twoDataDsc}}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<!--竖立进度条-->
<script>
  export default {
    name: 'progress',

    props: {
      oneDataDsc: {
        type: String,
        default: ''
      },
      twoDataDsc: {
        type: String,
        default: ''
      }
    },

    components: {},

    data () {
      return {
        oneData: {
          icon: require('../../assets/images/payResult/success.png'),
          text: '支付成功'
        },
        twoData: {
          icon: require('../../assets/images/payResult/delay.png'),
          text: '订单处理中'
        }
      }
    },

    mounted () {
    },

    methods: {
      incident () {
        this.$emit('incident')
      },
      imgName (item) {
        if (Number(item.checkStatus) === -1) {
          return 'await'
        } else if (Number(item.checkStatus) === 2) { // 不通过
          return 'error'
        } else if (Number(item.checkStatus) === 1) { // 通过
          return 'success'
        } else {
          return 'delay'
        }
      }
    },
    filters: {
      checkStatus (value) {
        if (value === -1) {
          return '待审核'
        } else if (value === 1) {
          return '通过'
        } else {
          return '不通过'
        }
      }
    }
  }
</script>

<style scoped lang="scss">
  @import "~styles/extends";

  .progress {
    margin-top: 16px;

    .chunk-list {
      .chunk-item {
        .title {
          @extend %flex-items-center;
          font-family: PingFangSC-Regular;
          font-weight: 400;
          font-size: 16px;
          line-height: 22px;

          .tag {
            @extend %flex-center;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            color: $theme-white;
            margin-right: 8px;
            text-align: center;
            font-weight: bold;

            img {
              width: 100%;
              height: 100%;
            }
          }

          .tag-bg {
            background: $theme-blue;
          }

          &-content {
            flex: 1;
            @extend %flex-justify-center-between;
            font-family: PingFangSC-Regular;
            font-weight: 400;

            label {
              font-size: 16px;
              line-height: 22px;
            }

            span {
              font-size: 14px;
              color: $theme-gray;
              line-height: 20px;
            }
          }
        }

        .text {
          padding: 2px 0 40px 22px;
          margin-left: 15px;
          border-left: 1px solid transparent;
          color: $theme-gray;
          font-size: 14px;

          .dsc {
            margin-top: 4px;
          }

          .button {
            display: inline-block;
            margin-top: 8px;

            button {
              padding: 4px 12px;
              font-size: 14px;
              font-family: PingFangSC-Regular;
              font-weight: 400;
              color: $theme-blue;
              line-height: 20px;
            }
          }
        }

        .text-border {
          border-left: 1px solid $theme-blue;
        }
      }

      .chunk-item:last-child {
        .text {
          padding-bottom: 0;
        }
      }
    }
  }
</style>
